_w = require('when');
MongoClient = require('mongodb').MongoClient;

db_url = 'mongodb://127.0.0.1:27017/taskDB';

exports.openDb = ->
	_w.promise (resolve, reject)->
		MongoClient.connect db_url, (err, db)->
			if err
				reject err
			else
				resolve db
